package com.mike.log;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.slf4j.LoggerFactory;
import org.slf4j.MDC;

import java.util.logging.Logger;

/**
 * Hello world!
 *
 */
public class App 
{
    static {
        System.setProperty("java.util.logging.config.file","/Users/will/git/knowledge/log/src/main/resources/logging.properties");
    }
    public static void main( String[] args )
    {
        MDC.put("test","test123123");
        //java.util.logging.Logger
        Logger logger = Logger.getLogger(App.class.getName());
        logger.severe("这是[severe]信息");
        logger.warning("这是[warning]信息");
        logger.info("这是[info]信息");
        logger.config("这是[config]信息");
        logger.fine("这是[fine]信息");
        logger.finer("这是[finer]信息");
        logger.finest("这是[finest]信息");

        //log4j
        org.apache.log4j.Logger logger4j = org.apache.log4j.Logger.getLogger(App.class);
        logger4j.info("log4j[info]");

        Log log = LogFactory.getLog(App.class);
        log.info("commonlog[info]");

        org.slf4j.Logger logsl4j = LoggerFactory.getLogger(App.class);
        logsl4j.info("slf4j[info]");
        MDC.clear();


    }
}
